package edu.Test;

import java.util.Arrays;

public class test4 {
    public static void main(String[] args) {
        String a = "china";
        System.out.println("a="+a);
        String a1 = new String("xiaoming");
        System.out.println("a1="+a1);
        char[] a2 = {'c','h','i','n','a'};
        System.out.printf("a2=");
        for (char b : a2) {
            System.out.printf(String.valueOf(b));
        }
        System.out.println();
        //String a3 = Arrays.toString(a2);
        String a3 = new String(a2);
        System.out.println("a3="+a3);
        char[] a4 = {'i','l','o','v','e','c','h','i','n','a'};
        System.out.printf("a4=");
        for (char c : a4) {
            System.out.printf(String.valueOf(c));
        }
        //                        起始下标  提取个数
        String a5 = new String(a4,0,10);
        System.out.println();
        System.out.println("a5="+a5);
        a = "1";
        System.out.println("end="+a+1);
    }
}
